class TreeNode {
    int val;
    TreeNode left;
    TreeNode right;

    TreeNode(int x) {
        val = x;
    }
}

public class mirrorTree {
    public TreeNode _mirrorTree(TreeNode root) {
        // 是否为空
        if (root == null)
            return root;
        TreeNode left = _mirrorTree(root.left);
        TreeNode right = _mirrorTree(root.right);

        root.left = right;
        root.right = left;
        return root;
    }

}
